﻿@using Higgs.Web.AtomPub.Configurations
@using Higgs.Web.AtomPub.Models
@{
    Layout = null;
    var repository = DependencyResolver.Current.GetService<IEntryRepository>();
}

<!DOCTYPE html>

<html>
<head>
    <title>Index</title>
    <link rel="service" type="application/atomsvc+xml" href="@AtomPubConfigSection.Current.AbsolutePath" />
    <style type="text/css">
        article
        {
            margin-bottom: 15px;   
        }
        article h1
        {
            padding: 5px 10px;
            background: #f1f1f1;   
        }
        article aside
        {
            border-top: 1px solid #c1c1c1;   
        }
    </style>
</head>
<body>
    <div>
        @foreach (var entry in repository.GetEntryList(0, 100, false, User.Identity))
        {
            <article>
                <h1>@entry.Title</h1>
                <div>
                    @Html.Raw(entry.ContentHtml)
                </div>
                <aside>
                    Date: @entry.PublishedDate
                </aside>
            </article>
        }
    </div>
    <label>Page was generated at @DateTime.Now</label>
</body>
</html>
